package com.example.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.model.pojo.PaymentRecord;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;

public interface PaymentRecordMapper extends BaseMapper<PaymentRecord> {

    @Select("SELECT * FROM payment_record WHERE employee_address = #{address} ORDER BY payment_date DESC LIMIT 12")
    List<PaymentRecord> selectLastYear(@Param("address") String employeeAddress);
    
    @Select("SELECT * FROM payment_record WHERE employee_address = #{address} AND ai_risk_flag = 1")
    List<PaymentRecord> selectRiskRecords(@Param("address") String employeeAddress);
}